package zaphod.toy.ogametool;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;

public class ScoutParserUtility
{
    public static final String DEUTERIUM = "deuterium";
    public static final String METAL = "metal";
    public static final String CRYSTAL = "crystal";
    public static final String ENERGY = "energy";
    private static ScoutParserUtility instance = new ScoutParserUtility();
    private ImageRegistry imageRegistry = new ImageRegistry();
    private final Clipboard clipBoard;

    private ScoutParserUtility()
    {
        @SuppressWarnings( "unused" )
        Display display;
        ImageDescriptor imageDescriptor;
        Image img;
        display = Display.getCurrent();

        imageDescriptor = getImageDescriptor( "m.gif" );
        img = imageDescriptor.createImage();
        imageRegistry.put( METAL, img );

        imageDescriptor = getImageDescriptor( "c.gif" );
        img = imageDescriptor.createImage();
        imageRegistry.put( CRYSTAL, img );

        imageDescriptor = getImageDescriptor( "d.gif" );
        img = imageDescriptor.createImage();
        imageRegistry.put( DEUTERIUM, img );

        imageDescriptor = getImageDescriptor( "e.gif" );
        img = imageDescriptor.createImage();
        imageRegistry.put( ENERGY, img );

        clipBoard = new Clipboard( display );

    }

    public static ScoutParserUtility getInstance()
    {
        return instance;
    }

    public ImageDescriptor getImageDescriptor( String path )
    {
        return ImageDescriptor.createFromFile( this.getClass(), path );
    }

    public ImageRegistry getImageRegistry()
    {
        return imageRegistry;
    }

    public Clipboard getClipBoard()
    {
        return clipBoard;
    }

}
